<div id="loginDiv">
    <h3>LOGIN</h3>
    <div class="error">
    <%
        String logout = request.getParameter("logout");
        if(logout != null && logout.equals("true")){
            request.getSession(true);
            session.setAttribute("currentSessionUser",null);
            %>
                Successful logout
            <%
        }
        
        String redirect = request.getParameter("redirect");
        if(redirect != null && redirect.equals("true")){
            request.getSession(true);
            session.setAttribute("currentSessionUser",null);
            %>
                Please log back in
            <%
        }
    
    String failReport = "";
    if(request.getParameter("fails")!=null){
    failReport = request.getParameter("fails");
    int fails = Integer.parseInt(failReport);
    if (fails==1 || fails==2)
    {
    int remAttempts = 3-fails;
    %>
    Invalid password, <%=remAttempts%> of 3 attempts remain
    <%
    }
    if (fails>2)
    {
    %>
    You have been locked. Pleas email- admin@internet.com
    <%
    }
    if (fails==-1)
    {
    %>
    Invalid username
    <%
    }
    }
    %>
    </div>
    <div class="formDiv">
    <form name="actionForm" action="LoginServlet" method="POST">
        <span>Username:</span>
        <input name="uname" type="text"></input>
        <span>Password:</span>
        <input name="password" type="password"></input>
        <input type="submit" value="submit"></input>
    </form>
    </div>
    <br/>
    <a href="register.jsp">New here? Register Now!</a>
</div>